﻿using System;
using System.Collections.Generic;
using Gameplay.PVE.Utils;
using UnityEngine;
using XLua;
using Yoozoo.Framework.Core;

namespace Gameplay.PVE.Survivor
{
    public class RpgMissionStageEventConfig
    {
        public int id;
        public int event_condition;
        public List<int> event_condition_value;
        public int event_trigger;
        public List<int> event_trigger_value;
        public List<string> string_value;
        public List<int> sub_event;
        public int max_trigger_times;
    }
    
    public partial class BattleConfigManager
    {
        private Dictionary<int, RpgMissionStageEventConfig> missionStageEventMap;
        public RpgMissionStageEventConfig GetStageEventConfig(int id)
        {
            if (missionStageEventMap.TryGetValue(id,out var config))
            {
                return config;
            }
            UnityEngine.Debug.LogError("事件配置找不到" + id);
            return null;
        }

        public static void PreloadRpgMissionStageEventConfig(LuaTable table)
        {
            PveUtils.PreloadRpgConfig(table,ref Instance.missionStageEventMap);
        }
    }
}
